import request from '@/utils/request';

/** 
 * @package 查询纸张采购单列表
 */
export const getPaperPurchaseOrderListApi = (data: any) => {
    return request({
        url: '/system/paperPurchaseOrder/list',
        method: 'post',
        data: data
    });
};

/**
 * @package 修改纸张采购单
 */

export const updatePaperPurchaseOrderApi = (data: any) => {
    return request({
        url: '/system/paperPurchaseOrder',
        method: 'put',
        data: data
    });
};

/**
 * @package 审批 1:审批同意 2 审批拒绝
 */

export const updatePaperPurchaseOrderApprovalApi = (data: any) => {
    return request({
        url: '/system/paperPurchaseOrder/approval',
        method: 'put',
        params: data
    });
};

/** 
 * @package 入库
 */

export const updatePaperPurchaseOrderInboundApi = (data: any) => {
    return request({
        url: '/system/paperPurchaseOrder/warehouseEntry',
        method: 'put',
        data: data
    });
};

/**
 * @package 纸张采购单对账
 */

export const updatePaperPurchaseOrderReconciliationApi = (data: any) => {
    return request({
        url: '/system/paperPurchaseOrder/paperReconciliation',
        method: 'put',
        data: data
    });
};

/**
 * @package 撤销对账
 */

export const updatePaperPurchaseOrderRevokeReconciliationApi = (data: any) => {
    return request({
        url: '/system/paperPurchaseOrder/revokeReconciliation',
        method: 'put',
        params: data
    });
};

/**
 * @package 采购入库详情
 */

export const getPurchaseAndStorageDetails = (id: any) => {
    return request({
        url: '/system/paperPurchaseOrder/getWarehouseEntryDetail?id=' + id ,
        method: 'get',
    });
};

/**
 * @package 删除
 */

export const deletePaperPurchaseOrderApi = (ids: any) => {
    return request({
        url: `/system/paperPurchaseOrder/${ids}`,
        method: 'delete',
    });
};